package com.vonchange.purchase.deed.service.impl;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.vonchange.purchase.deed.bean.Deed;
import com.vonchange.purchase.deed.dao.IDeedDao;
import com.vonchange.purchase.deed.service.IDeedService;
import com.vonchange.utils.crud.dao.IBaseDao;
import com.vonchange.headb.core.map.HeaMap;
import com.vonchange.utils.crud.service.normal.impl.BaseServiceImpl;
import com.vonchange.utils.date.DateUtil;
@Service
@Transactional
public class DeedServiceImpl extends BaseServiceImpl<Deed> implements IDeedService{
	@Resource
    private IDeedDao deedDao;
	@Override
	public IBaseDao<Deed> getDao() {
		// TODO Auto-generated method stub
		return deedDao;
	}
	
	public void initSave(Deed entity) {
		entity.setCreateTime(new Date());
		entity.setName(DateUtil.format("yyyy年MM月dd日 HH:mm:ss", new Date())+"的采购记录");
	}
	public void initUpdate(Deed entity) {
		entity.setUpdateTime(new Date());
	}
	public void initFind(HeaMap parameter) {
		if(null==parameter.get("isDelete_eq")){
			parameter.set("isDelete_eq", 0);
		}
	}
}